cmake_minimum_required(VERSION 2.6)
project(g2o_test)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)

find_package(OpenCV REQUIRED)
find_package(G2O REQUIRED)


include_directories(${OpenCV_INCLUDE_DIRS})
link_libraries(${OpenCV_LIBRARY_DIRS})

set(G2O_LIBS ${G2O_CORE_LIBRARY} ${G2O_STUFF_LIBRARY} 
             ${G2O_SOLVER_CHOLMOD}
             ${G2O_TYPES_DATA} ${G2O_TYPES_ICP} ${G2O_TYPES_SBA} ${G2O_TYPES_SLAM3D})
link_libraries(${G2O_LIBS} )

include_directories("/usr/include/suitesparse")

#set(G2O_INCLUDE_DIRS "/home/likun/bag/g2o-master/build")
#set(G2O_INCLUDE_DIRS "usr/local/include/g2o")
#include_directories(${G2O_INCLUDE_DIRS})

#find_package(G2O REQUIRED)
set(G2O_INCLUDE_DIRS "usr/local/include")
include_directories(${G2O_INCLUDE_DIRS} "/usr/local/include/eigen3" )
include_directories(${G2O_INCLUDE_DIRS} "/usr/include/eigen3" )



add_executable(g2o_test main.cpp)

target_link_libraries(g2o_test ${OpenCV_LIBS})

install(TARGETS g2o_test RUNTIME DESTINATION bin)
